﻿@model EventSys.BussinesEntities.Evento

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <div class="editor-label">
        @Html.LabelFor(model => model.idEvents)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.idEvents)
        @Html.ValidationMessageFor(model => model.idEvents)
    </div>

    <fieldset>
        <legend>Evento</legend>

        <table>
            <tr>
                <td>     
                    @Html.CheckBox("EventoSimple")
                    @Html.Label("Evento Simple")
                </td>
                <td> </td>
                <td> </td>

                <td> Fecha Inicio:</td>
                <td>
                     @(Html.Kendo().DatePicker().Name("FechaIni").Value("FechaIni").HtmlAttributes(new {style ="width:110px"}))
                </td>

            </tr>
            <tr>
                <td> Nombre: </td>                
                <td>
                    @Html.EditorFor(model => model.NomEvento)
                    @Html.ValidationMessageFor(model => model.NomEvento)
                    
                    Tipo Evento: 
                    @Html.DropDownList("idTipoEvento")
                    @Html.ValidationMessageFor(model => model.idTipoEvento)
                </td>               
                <td> </td>

                <td> Fecha Final:  </td>
                <td>
                    @(Html.Kendo().DatePicker().Name("FechaFin").Value("FechaFin").HtmlAttributes(new {style ="width:110px"}))
                </td>
            </tr>
            <tr>
                <td >Organizador:</td>
                <td> 
                    @Html.EditorFor(model => model.Organizador, new { style = "width:275px;"})
                    @Html.ValidationMessageFor(model => model.Organizador)  
                </td>
                
                <td> </td>
                
                <td> Carrera: </td>
                <td>
                    @Html.EditorFor(model => model.Carrera)
                    @Html.ValidationMessageFor(model => model.Carrera)
                </td>
            </tr>
            <tr>
                <td> Informes:</td>
                <td>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Informes)
                        @Html.ValidationMessageFor(model => model.Informes)
                    </div>
                </td>

                <td> </td>

                <td>Sede:</td>
                <td>
                    <div class="editor-field">
                        @Html.DropDownList("Sede",new MultiSelectList(new[] {"UPN-CAJAMARCA", "UPN-LIMA", "UPN-TRUJILLO"}))
                        @Html.ValidationMessageFor(model => model.Sede)
                    </div>
                </td>
            </tr>

            <tr>
                <td> 
                    <div class="editor-label">
                        @Html.LabelFor(model => model.Estado)
                    </div>
                </td>
                <td>
                    <div class="editor-field">
                        @Html.DropDownList("idEstado")
                        @Html.ValidationMessageFor(model => model.idEstado)
                    </div>
                </td>
                <td> </td>
                <td>
                    @Html.CheckBox("IngresoLibre")
                    @Html.Label("Ingreso Libre")
                </td>
            </tr>
        </table>

        <!--  SECCION DE INVERSION   -->
        <fieldset style="border: 2px groove #ccc; background: #e8eac9; width: 300px;">
            <legend>Inversion</legend>
            @*<form action="javascript:fn_Agregar()" method="post" id="frmdetInv">*@
                <div id="divContenedorTabla">
                    <p>  <input type="button" value="Agregar" class="clsAgregarFila" id="agregarf">  </p>
                    <table id="detalleInv" class="lista" border="1">
                        <thead>
                            <tr>
                                <th>Tipo de Asistente</th>  <th>Monto</th>  <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            @*</form>*@
        </fieldset>

        <!--  SECCION DE AUSPICIADORES   -->
        <fieldset style="border: 2px groove #ccc; background: #e8eac9; width: 300px;">
            <legend>Auspiciadores:</legend>
            @*<form action="javascript:fnAgregar()" method="post" id="frmdetAusp">*@
                <p>  
                    @(Html.Kendo().AutoComplete()
                        .Name("auspiciador")
                        .DataTextField("Marca")
                        .Placeholder("Seleccionar un Auspiciador...")
                        .MinLength(1)
                        .Filter("Contains")
                        .HtmlAttributes(new { style = "width:200px" })
                        .DataSource(source =>  {
                            source.Read(read =>   {   read.Action("GetAuspiciador", "Auspiciador");     });
                        })
                    )
                <input type="button" value="Añadir" class="clsAgregarAusp" id="agregarA">  </p>
                @*<button type="button" id="add">Añadir</button>*@

                <div id="divContenedorTabla2">
                    <table id="detAuspiciador" border="1">
                        <thead>
                            <tr>
                                <th>Id</th>  <th>Auspiciador</th>  <th>&nbsp;</th>
                            </tr>
                        </thead>
                        <tbody>  </tbody>
                    </table>
                </div>
            @*</form>*@
        </fieldset>
        
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@*@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}*@


